<%@page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HXNT IP网络质量及应用监测系统</title>

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/easyui/themes/myself/easyui.css"/>  
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/easyui/themes/icon.css"/>
<%@ include file="./common/taglibs.jsp"%>
<%@ include file="./common/meta.jsp"%>
<style type="text/css">
*{margin:0;padding:0}
#logoside{
	float:left;
	height:60px;
	line-height:60px;
}
#logoside img{
	float:left;
	margin:10px 5px 10px 5px;
}
#logoside span{
	margin-left:5px;
	font-size:26px;
	font-family:"Times New Roman", "黑体";
	color:#fefefe;
}
#briefside {
	float:right;
	padding:5px 10px 0px 10px;
	height:22px;
	line-height:22px;
	font-size:12px;
	color:white;		
}
#cmdside {
	text-align:right;
	margin-top:5px;
}

#cmdside a{
	text-decoration:none;
	line-height:22px;
	color:#fff;
}
#cmdside a:hover {
	text-decoration:underline;
}
#fpanel div {padding:3px;}
</style>
<script type="text/javascript">
function loadPage(name,url) {
	if ($('#tc').tabs('exists',name)){
		$('#tc').tabs('select', name);
	} else {
		$("#tc").tabs('add',{
			title: name,
			content: '<iframe id="content" scrolling="auto" frameborder="0"  src=\".' +  url + '\" style="width:100%;height:100%;"></iframe>',
			closable: true,
			cache: false					
		});
	}
}
function closeCurrent() {
	var selectTitle = $("#tc").tabs('getSelected').panel('options').tab.text();
	$("#tc").tabs('close',selectTitle);
}
function closeOther() {
	var options = $("#tc").tabs('getSelected').panel('options');
	var tabs = $("#tc").tabs('tabs');
	var length = tabs.length;
	for (var i = 0; i < length; i++) {
        var onetab = tabs[0];
        var titleCurrent = onetab.panel('options').tab.text();
        $("#tc").tabs("close", titleCurrent);
	}
	$("#tc").tabs("add",options);
}

function closeAll() {
	var tabs = $("#tc").tabs('tabs');
	var length = tabs.length;
	for (var i = 0; i < length; i++) {
        var onetab = tabs[0];
        var title = onetab.panel('options').tab.text();
        $("#tc").tabs("close", title);
	}

}
$(function(){
    /* $("#tc").bind('contextmenu',function(e){  
        e.preventDefault();
        $('#mm').menu('setText',{text: title,target: $("#m1")}).menu('show', {  
            left: e.pageX,  
            top: e.pageY  
        });  
    }); */
    $('#tc').tabs({   
        onContextMenu: function(e,title){   
            e.preventDefault();
            $('#mm').menu('setText',{text: '关闭' + title,target: $('#m1')}).menu('show', {  
                left: e.pageX,  
                top: e.pageY  
            });    
        }   
    });
		    
    <c:forEach items="${accordions}" var="menu">
	    $("#myAccordion").accordion('add',{title:'${menu.text}',iconCls:'${menu.iconCls}',fit:true,border:false,content:'${menu.content}'});
    </c:forEach>
    $("#myAccordion").accordion('select','系统维护');
	//loadPage('${homePage}');
});
</script>
</head>
<body class="easyui-layout">

<div data-options="region:'north',border:false" style="height:60px;background:#0B5F3D;">
<div id="logoside">
<img src="images/logo.gif" width="40px" /><span>HXNT网络监测系统</span>
</div>
<div id="briefside">
	<div>欢迎您：<span><security:authentication property="name" /></span></div>
	<div id="cmdside"><a href="./j_spring_security_logout" id="exitbtn">退出</a></div>
</div>
</div>
<div data-options="region:'west',split:true,tools: [{   
    iconCls:'icon-reload',   
    handler:function(){location='./index.action';}   
  }]" title="导航菜单" style="width:170px;border:1px solid #ddd">
	<div class="easyui-accordion" data-options="fit:true,border:false" id="myAccordion">
		<!-- <div title="组网拓扑图" style="padding: 10px;">
			<ul class="easyui-tree" data-options="fit:true"
				style="margin-top: -10px; margin-left: -20px; margin-right: -10px;">
				<li><div onclick="loadPage('topo')">拓扑图管理</div></li>
			</ul>
		</div> -->
	</div>
</div>
<div data-options="region:'center'" style="border: 1px solid #ddd">
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'center',border:false"
			style="text-align: center; background: #efefef">
			<div id="tc" class="easyui-tabs"
				data-options="fit:true,border:false" style="padding: 5px;"></div>
		</div>
		<div data-options="region:'south'"
			style="clear: both; height: 20px; background: #0B5F3D; color: #fff; line-height: 20px; padding: 0 5px; overflow: hidden;">
			<div style="float: left">系统准备就绪。</div>
			<div style="float: right">深圳华信网通技术有限公司版权所有</div>
		</div>
	</div>
</div>

	<div id="mm" class="easyui-menu" style="width:120px;">  
	    <div id="m1" onclick="javascript:closeCurrent();">关闭当前</div>
	    <div onclick="javascript:closeOther();">关闭其他</div>
	    <div onclick="javascript:closeAll();">关闭所有</div>
	</div>
</body>
</html>